<?php
require_once("vcl/vcl.inc.php");
//Includes
use_unit("comctrls.inc.php");
use_unit("components4phpfull/jtdatepicker.inc.php");
use_unit("components4phpfull/jtsitetheme.inc.php");
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");

//Class definition
class Emp_Drive extends Page
{
       public $dpdate = null;
       public $hiddenEmp = null;
       public $cmbtype = null;
       public $btnCancel = null;
       public $btnSubmit = null;
       public $memoComments = null;
       public $edrefnum = null;
       public $edcost = null;
       public $edassessed = null;
       public $edDesc = null;
       public $Label7 = null;
       public $Label6 = null;
       public $Label5 = null;
       public $Label4 = null;
       public $chkAtfault = null;
       public $chkPersonalInjury = null;
       public $Label3 = null;
       public $Label2 = null;
       public $Image2 = null;
       public $Label1 = null;
       public $JTSiteTheme1 = null;
       function Emp_DriveCreate($sender, $params)
       {
       $emp = $_GET['emp'];
       $this->hiddenEmp->setValue($emp);

       $this->dpdate->Text='';
       $this->edDesc->Text='';
       $this->edassessed->Text='';
       $this->edcost->Text='';
       $this->edrefnum->Text='';
       $this->memoComments->Text='';


       }



       function btnSubmitClick($sender, $params)
       {
       $result = mysql_query("insert into emp_drivinghistory_tbl (emp_id,
       company_id,
       date,
       type,
       description,
       point_assessed,
       cost,
       ref_num,
       comments,
       at_fault,
       personal_injury)

       values ('".$emp_id."',
       '".$_SESSION['company_id']."',
       '".$this->dpdate->Text."',
       '".$this->cmbtype->getItemIndex()."',
       '".$this->edDesc->Text."',
       '".$this->edassessed->Text."',
       '".$this->edcost->Text."',
       '".$this->edrefnum->Text."',
       '".$this->memoComments->Text."')");

       redirect('details_emission.php?veh='.$veh_id);


       }

}

global $application;

global $Emp_Drive;

//Creates the form
$Emp_Drive=new Emp_Drive($application);

//Read from resource file
$Emp_Drive->loadResource(__FILE__);

//Shows the form
$Emp_Drive->show();

?>